package com.itheima.api.string.equals;

import java.util.Scanner;

/**
 * @author Anomaly
 * @date 2022/12/6 17:04
 */
public class StringDemo {
    public static void main(String[] args) {
        String name = "root";
        String password = "123456";

        Scanner scanner = new Scanner(System.in);
        System.out.println("输入name");
        String inputName = scanner.next();
        System.out.println("输入password");
        String inputPassword = scanner.next();
        System.out.println("--------------------输入");
        System.out.println(inputName);
        System.out.println(inputPassword);
        System.out.println("--------------------==比较");
        // == 比较的是地址
        System.out.println(name == inputName);
        System.out.println(password == inputPassword);
        System.out.println("--------------------equals");
        System.out.println(name.equals(inputName));
        System.out.println(password.equals(inputPassword));
        System.out.println("--------------------equalsIgnoreCase");
        System.out.println(name.equalsIgnoreCase(inputName));
        System.out.println(password.equalsIgnoreCase(inputPassword));
    }
}
